package com.javawork.igossip;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;

import android.R.array;

import com.javawork.igossip.model.*;

public class NetworkHelper {
	public static User getUserInfo(Integer userid) {
		User u = new User();
		u.setAllInfo("haha", "...", null, new String[] {});
		return u;
	}

	public static void updateMyUserInfo(User userinfo) {

	}

	public static ArrayList<Gossip> fetchNewsFeed(Integer last_id) {
		ArrayList<Gossip> list = new ArrayList<Gossip>();
		Gossip g = new Gossip();
		g.content = "a new gossip from server";
		g.target = "XXX";
		g.source = "YYY";
		list.add(g);
		return list;
	}

	public static ArrayList<Message> fetchAllPrivateMessage(Integer last_id) {
		ArrayList<Message> list = new ArrayList<Message>();
		Message m = new Message();
		m.content = "a new msg from server";
		list.add(m);
		return list;
	}

	public static ArrayList<Message> fetchReplyforGossip(Integer gossip_id) {
		Message m = new Message();
		m.content = "this is a reply msg.";
		m.target = "XXX";
		m.source = "YYY";
		ArrayList<Message> list = new ArrayList<Message>();
		list.add(m);
		return list;
	}

	public static ArrayList<User> fetchAllContact() {
		ArrayList<User> list = new ArrayList<User>();
		User u = new User();
		u.username = "Zhang";
		u.uid = 1;
		u.gender = 0;
		u.description = "this is a description.";
		list.add(u);
		return list;
	}

	public static Integer commitNewGossip(Gossip g) {
		return g.uid + 1;
	}

	public static Integer commitNewMessages(Message m) {
		return m.uid + 1;
	}
}
